$("#play").click(function () {
    console.log($(this).css("background-image"));
    if ($(this).css("background-image") === 'url("http://127.0.0.1:5500/imgs/index/pause.png")') {
        $(this).css("background-image", 'url("http://127.0.0.1:5500/imgs/index/play.png")');
    }
    else {
        ($(this).css("background-image") === 'url("http://127.0.0.1:5500/imgs/index/play.png")')
        $(this).css("background-image", 'url("http://127.0.0.1:5500/imgs/index/pause.png")');
    }
});
function play() {

    var swiper_l = new Swiper('.swiper-container-l', {
        spaceBetween: 30,
        centeredSlides: true,
        autoplay: {
            delay: 2500,
            disableOnInteraction: false,
        },
        pagination: {
            el: '.banner-pointer',
            clickable: true,
        },
        loop: true,
    });
    var swiper_r = new Swiper('.swiper-container-r', {
        spaceBetween: 30,
        centeredSlides: true,
        effect: 'fade',
        autoplay: {
            delay: 2500,
            disableOnInteraction: false,
        },
        pagination: {
            el: '.banner-pointer',
            clickable: true,
        },
        loop: true,
    });
}   
var mySwiper_iphone = new Swiper('.goods-container-iphone', {

})
var mySwiper_ipad = new Swiper('.goods-container-ipad', {
                
})
var mySwiper_watch = new Swiper('.goods-container-watch', {
                
})

      var swiper = new Swiper('.goods-container-img', {
      spaceBetween: 30,
      centeredSlides: true,
      autoplay: {
        delay: 2500,
        disableOnInteraction: false,
      },
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
        type: 'progressbar',
      },

    });
play();

//index页面选项卡效果

$(".index-goods-btn-iphone").mouseover(function(){
    mySwiper_iphone.slideTo($(this).index());  
})

$(".index-goods-btn-ipad").mouseover(function(){
    mySwiper_ipad.slideTo($(this).index());  
})

$(".index-goods-btn-watch").mouseover(function(){
    mySwiper_watch.slideTo($(this).index());  
})

// $(document).ready(function(){
//     hide_goods_list($(".index-goods-btn-iphone"),$(".goods-container-iphone"));
//     hide_goods_list($(".index-goods-btn-ipad"),$(".goods-container-ipad"));
//     hide_goods_list($(".index-goods-btn-watch"),$(".goods-container-watch"));
//   });
//计时器
function countDown( maxtime,fn ) {  
    var timer = setInterval(function() { 
      if( !!maxtime ){  
       var day = Math.floor(maxtime / 86400),
       hour = Math.floor((maxtime % 86400) / 3600),
      minutes = Math.floor((maxtime % 3600) / 60), 
      seconds = Math.floor(maxtime%60), 
      msg = "距离结束还有:</br>"+day+"天"+hour+"时"+minutes+"分"+seconds+'秒';  
      fn( msg ); 
      --maxtime;  
     } else {  
      clearInterval( timer ); 
      fn("时间到，结束!"); 
     }  
    }, 1000); 
   } 

   countDown(86400,function( msg ) { 
    document.querySelector('#timer-container').innerHTML = msg; 
   }) 
  
